<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<head>
    <style type="text/css">
        .mechanics {

        }
        .automation {
            display:none;
        }
    </style>
</head>

<body class="hold-transition skin-blue sidebar-mini">
<section class="content">
    <div class="row" style="margin-bottom: 24px">
        <!--<a id="btn-save" shiro:hasPermission="xxx" href="javascript:void(0);"
           class="btn btn-info pull-right" style="margin-right: 10px">
            <span class="Bold">打印</span>
        </a>-->
    </div>
    <form id="sheetForm" class="form-horizontal">
        <div class="row">
            <div class="col-xs-11" style="margin-left: 4%;">
                <input type="hidden" name="id" th:value="${asse.id}">
                <table class="t1 t3">
                    <thead>
                    <tr>
                        <td colspan="9">
                            <img th:src="@{/img/logo3.jpg}" width="64px" height="40px" style="margin-top: -30px">
                            <div style="display: inline-block;margin-top: 5px;margin-left: 20px">
                                <span style="letter-spacing: 24px;display: block;line-height: 20px">&nbsp;辽宁忠旺机械设备制造有限公司</span>
                                <span style="display: block;font-size: 12px;line-height: 20px">Liaoning Zhongwang Machinery Equipment Manufacturing Co., Ltd</span>
                            </div>
                        </td>
                        <td colspan="2">装配派工单</td>
                        <td rowspan="4" style="width: 8.5%">
                            <div id="qrCode-div" style="display: none"></div>
                            <img id="qr-img" width="100px" height="100px">
                        </td>
                        <td style="width: 3.3%"></td>
                    </tr>
                    <tr>
                        <td style="width: 6%">生产令号</td>
                        <td style="width: 11%">
                            [[${asse.prodNo}]]
                        </td>
                        <td style="width: 7.3%">项目名称</td>
                        <td colspan="2">
                            [[${asse.proName}]]
                        </td>
                        <td style="width: 6%">订单数量</td>
                        <td style="width: 7%">
                            [[${asse.proNum}]]
                        </td>
                        <td style="width: 9.1%">类型</td>
                        <td style="width: 6.9%">
                            [[${asse.special}]]
                        </td>
                        <td style="width: 7.9%">部分</td>
                        <td style="width: 9.8%">
                            [[${asse.part}]]
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td rowspan="2">装配图号</td>
                        <td colspan="2" rowspan="2">
                            [[${asse.drawNo}]]
                        </td>
                        <td rowspan="2" style="width: 6%">装配名称</td>
                        <td colspan="3" rowspan="2">
                            [[${asse.drawName}]]
                        </td>
                        <td>装配数量</td>
                        <td>
                            [[${asse.drawNum}]]
                        </td>
                        <td>要求完成时间</td>
                        <td>
                            [[${asse.compTime}]]
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>重量Kg</td>
                        <td>
                            [[${asse.drawWeight}]]
                        </td>
                        <td>部门</td>
                        <td>
                            [[${asse.deptName}]]
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>路线</td>
                        <td>序号</td>
                        <td>工序</td>
                        <td colspan="9">工艺内容</td>
                        <td></td>
                    </tr>
                    </thead>
                    <tbody id="card">
                    <tr th:each="d : ${details}" class="mechanics">
                        <td>
                            [[${d.route}]]
                        </td>
                        <td>
                            [[${d.orderNo}]]
                        </td>
                        <td>
                            [[${d.process}]]
                        </td>
                        <td colspan="9" style="text-align:left;padding-left: 5px;">
                            <div th:utext="${d.comment}"></div>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr class="automation">
                        <td>注<br>意<br>事<br>项</td>
                        <td colspan="11" style="text-align:left;padding-left: 5px;height: 400px;">
                            <div th:utext="${asse.remark}"></div>
                        </td>
                        <td></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="col-xs-11" style="font-size: 14px;line-height: 200%;margin-left: 4%;">
                <div class="col-xs-3" style="padding-left: 0">提报人： [[${asse.createName}]]&nbsp;&nbsp;[[${#dates.format(asse.createTime,'yyyy.MM.dd')}]]</div>
                <div class="col-xs-3 bottom form-inline">联系电话：[[${asse.createTel}]]</div>
            </div>
        </div>
    </form>
</section>
<div id="div-route" style="display: none">
    <select class="form-control" name="route" title="">
        <option th:each="r : ${routes}" th:value="${r.name}"
                th:text="${r.name}"></option>
    </select>
</div>
<div id="div-process" style="display: none">
    <select class="form-control" name="process" title="">
        <option th:each="p : ${processes}" th:value="${p.name}"
                th:text="${p.name}"></option>
    </select>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    /** 路线或注意事项显隐控制 */
    function setControlPage(){
        let specialCon = [[${asse.special}]];
        if (specialCon == "自动化"){
            $(".automation").show();
            $(".mechanics").hide();
        } else {
            $(".automation").hide();
            $(".mechanics").show();
        }
    }

    let gloDeptName = toUtf8([[${asse.prodNo}]] + '|'+[[${asse.drawNo}]]+'|'+[[${asse.partId}]]+'|2');

    $("#qrCode-div").qrcode({
        width: 80,
        height: 80,
        text: gloDeptName
    });

    $(function () {

        /** 路线或注意事项显隐控制 */
        setControlPage();

        let c = document.getElementsByTagName('canvas')[0];
        $("#qr-img").attr("src", c.toDataURL("image/png"));
    })
</script>
</body>
</html>
